/**
 * class to display playerinfo
 */
import java.awt.Button;
import java.awt.GridLayout;

import javax.swing.JLabel;
import javax.swing.JPanel;


/**
 * @author Master
 * @version $Revision: 1.0 $
 */
public class PlayerInfoPanel extends JPanel{
	
	
	/**
	 * Field SHI.
	 * (value is 10)
	 */
	private static final int SHI = 10;
	
	/**
	 * Field BA.
	 * (value is 8)
	 */
	private static final int BA = 8;

	/**
	 * Constructor for PlayerInfoPanel.
	 */
	public PlayerInfoPanel() {
		setLayout(new GridLayout(BA, BA));
		add(new JLabel("Name: "));
		add(new JLabel("" + GameInfo.getName()));
		add(new JLabel("Difficulty: "));
		add(new JLabel(GameInfo.getDifficulty()));
		add(new JLabel("Planet: "));
		add(new JLabel("" + PlayerInfo.getCurrentPlanet().getName()));
		add(new JLabel("Fuel: "));
		add(new JLabel("" + PlayerInfo.getFuel()));
		add(new JLabel("Money: "));
		add(new JLabel("" + PlayerInfo.getMoney()));
		for (int i=0;i < SHI;i++){
			add(new JLabel(GoodInfo.getName()[i] + ": "));
			add(new JLabel("" + PlayerInfo.getStock(i)));
		}
		final Button exitButton=new Button("Exit");
		exitButton.addActionListener(new ExitInfoListener());
		add(exitButton);
	}
}
